    import redis.clients.jedis.Jedis;
    import redis.clients.jedis.Pipeline;

    public class JedisTest {
        public static void main(String[] args) {
            Jedis jedis = new Jedis("127.0.0.1", 6379);
            long start = System.currentTimeMillis();
    //        for (int i = 0; i < 10000; i++) {
    //            jedis.hset("hashkey", "field" + i, "value" + i);
    //        }
            for (int i = 0; i < 10; i++) {
                Pipeline pipeline = jedis.pipelined();
                for (int j = i*1000; j < (i+1)*100; j++) {
                    pipeline.hset("hashkey", "field" + i, "value" + i);
                }
                pipeline.syncAndReturnAll();
            }
            long end = System.currentTimeMillis();
            System.out.println("耗费的时间为:" + (end-start) + "ms");
        }
    }
